@extends('layout')
@section('content')
    <nav class="breadcrumb">
        <i class="Hui-iconfont">&#xe67f;</i>
        当前位置: <span class="c-gray en">&gt;</span>
        游戏管理 <span class="c-gray en">&gt;</span>
    <a style="color:blue;" href="{{ url('nonPublicVersion/gameConfig') }}" >游戏配置列表</a> <span class="c-gray en">&gt;</span>
        新增配置
    </nav>
    <article class="page-container" id="app">
        <form action="{{ url('nonPublicVersion/gameConfig') }}" method="post" class="form form-horizontal" id="form-member-add">
            {{ csrf_field() }}
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">游戏名称：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="text" class="input-text" value="" placeholder="" id="app_name" name="app_name">
                </div>
            </div>

            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">
                    <span class="c-red">*</span>游戏简写（key）：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="text" class="input-text" value="" placeholder="" id="key" name="key">
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">
                    <span class="c-red">*</span>游戏支付回调地址：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="text" class="input-text" value="" placeholder="" id="callback_url" name="callback_url">
                </div>
            </div>

            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">
                    版本：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="text" class="input-text" value="" placeholder="" id="version" name="version">
                </div>
            </div>

            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">
                    热云APPID：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="text" class="input-text" value="" placeholder="" id="version" name="hot_cloud_id">
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">
                    <span class="c-red">*</span>游戏简介：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <textarea name="introduct" cols="" rows="" class="textarea" placeholder=""></textarea>
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">备注：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <textarea name="note" cols="" rows="" class="textarea" placeholder=""></textarea>
                </div>
            </div>

            <div class="row cl">
                <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
                    <input class="btn btn-primary radius" type="submit" value="提交">
                </div>
            </div>
        </form>

    </article>
@endsection
@section('script')
    <script type="application/javascript">
        $(function () {

            $("#name").blur(function () {
                var name = $(this).val();
                request('{{ url("/nonPublicVersion/checkGame") }}',function (data) {

                },{name:name},'post');
            })

            $("#form-member-add").submit(function () {
                var url = $(this).attr('action');
                request(url,function (data) {
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.$('#btn-refresh').click();
                    parent.layer.close(index);
                    window.location.href = '{{ url('/nonPublicVersion/gameConfig') }}';
                },$(this).serialize(),'post')
                return false;
            });
        })
    </script>
@endsection